#ifndef __PlayLayer__
#define __PlayLayer__

#include "IDialog.h"
#include "PokerPlayer.h"
#include "PlayerUI.h"

class PlayLayer : public IDialog<Layer>
{
public:
    PlayLayer();
    virtual ~PlayLayer();
    CREATE_FUNC(PlayLayer);

protected:
    virtual const char* csbName() const {return "ui/GameLayer.csb";}
	virtual void onUILoaded();

    void initUI();

    void onPlayerAction(const PokerPlayer* thePlayer, PLAYER_STATE state, int32_t card);
    void showBottomCard(bool show);

    void whenUserClickCardUI(Ref* sender);
    void restart(Ref* sender);

    void playGameOverAnim(bool selfWin, bool boseWin);

private:
    Button* m_btnStart;//开始
    Button* m_btnMaster;//叫地主
    Button* m_btnSkip;//不叫
    Button* m_btnIgnore;//不出
    Button* m_btnReset;//重选
    Button* m_btnTipCard;//提示
    Button* m_btnPostCard;//出牌
    Sprite* imgBg;
    Node* m_opGroup;
    Node* m_initGroup;
    Node* m_cardZone;
    std::map<uint8_t, PlayerUI*> m_players;
};

#endif 

